import request from '@/utils/request'

// 获取支付记录列表
export function getPaymentList(params) {
  return request({
    url: '/api/payments',
    method: 'get',
    params
  })
}

// 获取支付记录详情
export function getPaymentDetail(id) {
  return request({
    url: `/api/payments/${id}`,
    method: 'get'
  })
}

// 创建支付记录
export function createPayment(data) {
  return request({
    url: '/api/payments',
    method: 'post',
    data
  })
}

// 申请退款
export function refundPayment(id) {
  return request({
    url: `/api/payments/${id}/refund`,
    method: 'post'
  })
}

// 获取支付统计数据
export function getPaymentStats(params) {
  return request({
    url: '/api/payments/stats',
    method: 'get',
    params
  })
} 